function startTransition(HTMLPAGE) {
    const body = document.body;

    // 1. 添加雾蒙效果
    body.classList.add('masked');
    // 2. 0.5秒后显示加载动画
    setTimeout(() => {
        body.classList.add('loading');
        // 3. 1.5秒后跳转(模拟网络请求)
        setTimeout(() => {
            // 存储状态用于新页面渐显
            sessionStorage.setItem('pageTransition', 'fade-in');
            window.location.href = HTMLPAGE;
        }, 500);
    }, 300);
}

document.addEventListener('DOMContentLoaded', function () {
    if (sessionStorage.getItem('pageTransition') === 'fade-in') {
        document.documentElement.style.opacity = 0;
        document.documentElement.style.transition = 'opacity 0.5s ease';
        setTimeout(() => {
            document.documentElement.style.opacity = 1;
            sessionStorage.removeItem('pageTransition');
        }, 50);
    }
});
